export const Register = {}

//读取单个命令
Register.getRegisterBitValue = function (stateData, starRag, regBit) {
  var v = 1 << regBit
  if ((stateData & v) == v){
    return true
  } else {
    return false
  }
}

//读取马桶4-7位的值
Register.getRegister4LowValue = function(stateData) {
  return (stateData & 0x00f0) >> 4
}

//读取马桶1-3位的值
Register.getRegister4LowValuebefore = function( stateData) {
  return (stateData & 0x000f);
}

//读取马桶12-15位的值
Register.getRegister4HighValue = function(stateData) {
  return (stateData & 0xf000) >> 12;
}

//读取马桶8-11位的值
Register.getRegister4HighValuebefore = function(stateData) {
  return (stateData & 0x0f00) >> 8;
}
